<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="box">
	<form:form method="post" modelAttribute="airportModel">
	
		<c:if test="${not empty airports }">
			<table border="1">
				<tr>
					<td>IATA Code</td>
					<td>Airport Name</td>
					<td>City</td>
					<td>Country</td>
					<td>Latitude</td>
					<td>Longitude</td>
				</tr>
				<c:forEach items="${airports}" var="airport">
					<tr>
						<td>${airport.iata}</td>
						<td>${airport.name}</td>
						<td>${airport.city}</td>
						<td>${airport.country}</td>
						<td>${airport.latitude}</td>
						<td>${airport.longitude}</td>
					</tr>
				</c:forEach>
			</table>
		</c:if>
	
		<table>
			<tr><td>IATA Code</td><td><form:input path="iata" /></td></tr>
			<tr><td>Airport Name</td><td><form:input path="name" /></td></tr>
			<tr><td>City</td><td><form:input path="city" /></td></tr>
			<tr><td>Country</td><td><form:input path="country" /></td></tr>
			<tr><td>Latitude</td><td><form:input path="latitude" /></td></tr>
			<tr><td>Longitude</td><td><form:input path="longitude" /></td></tr>
			<tr><td colspan="2"><input type="submit" class="button"/></td></tr>
		</table>
		
	</form:form>
</div>